Replication for "Revolutionary Ideals and International Aggression"
Foreign Policy Analysis
Matthew Timmerman 
mt5082a@american.edu
									
-this filename: revo_agression.do

-data filenames: dataset for regressions: revo_aggression.dta
				 dataset for survival analysis: revo_aggression_survival.dta
				 
-created using Stata 14.2

-STATA packages: Clarify

***Log File***
log using revo_aggression_log

***Installing Clarify***
net from https://gking.harvard.edu/clarify
net install clarify

***Table 1 (using revo_aggression_main.dta)***
use "C:\Users\Matthew\OneDrive for Business\FPA\replication\final\revo_aggression_main.dta", clear

For Number of External vs. Internal Leaders See "Revo_Aggression_Coding" 
External Revolutionary Leaders: 24
Internal Revolutionary Leaders: 52

MIDs Initiated
total initmid, over (external)

MIDs Per Year
ttest initmid, by (external)

Average Years in Office
count if external == 1
count if external == 0
External : 315 years of external leaders in office / 24 external leaders = 13.13 average years in office
Internal : 522 years of internal leaders in offfice / 52 internal leaders = 10.04 average years in office

***Table 2 (using revo_aggression_main.dta)***
Model 1: Negative Binomial
estsimp nbreg initmid external borders cap milex majpow export,cluster(ccode)
estout
drop b1
drop b2
drop b3
drop b4
drop b5
drop b6
drop b7

Model 2: Logit
estsimp logit initmid_binary external borders cap milex majpow exports,cluster(ccode)
estout
drop b1
drop b2
drop b3
drop b4
drop b5
drop b6
drop b7
drop b8

***Figure 1 (using revo_aggression_main.dta)
estsimp nbreg initmid external borders cap milex majpow export,cluster(ccode)
setx external 1
simqi
setx external 0
simqi
drop b1
drop b2
drop b3
drop b4
drop b5
drop b6
drop b7
drop b8

save "C:\Users\Matthew\OneDrive for Business\FPA\replication\final\revo_aggression_main.dta", replace

***Figure 2 (using revo_aggression_survival.dta)***
use "C:\Users\Matthew\OneDrive for Business\FPA\replication\final\revo_aggression_survival.dta", clear
stset time1, failure(eventmid==1) scale(1)
stsum, by(revotype)
sts graph, by(revotype)
sts test external, logrank

***Figure 3 (using revo_aggression_survival.dta)***
stset time2, failure(eventouster==1) scale(1)
stsum, by(revotype)
sts graph, by(revotype)
sts test external, logrank

***Robustness Checks in Appendix***
A-2 (using revo_aggression_survival.dta)
ttest time2, by (external)

save "C:\Users\Matthew\OneDrive for Business\FPA\replication\final\revo_aggression_survival.dta", replace

A-4 (using revo_aggression_main.dta)
use "C:\Users\Matthew\OneDrive for Business\FPA\replication\final\revo_aggression_main.dta", clear
tabulate external personalist_jlw, chi2 expected

A-5 (using revo_aggression_survival.dta)
tabulate external rebel, chi2 expected

save "C:\Users\Matthew\OneDrive for Business\FPA\replication\final\revo_aggression_main.dta", replace
